//package data;
//
//import java.io.BufferedReader;
//import java.io.BufferedWriter;
//import java.io.FileReader;
//import java.io.FileWriter;
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.HashSet;
//
//public class DBoxGenerator {
//	//features and roles names
//	public static final String ft = "title";
//	public static final String fy = "year";
//	public static final String fn = "name";//author name
//	public static final String fa = "affiliation";
//	public static final String fc = "country";
//	public static final String rp = "hasAuthors";//role
//	public static final String ri = "inProceedings";//role
//	//concepts
//	public static final String cp = "Publication";
//	//each venue is a PConcept
//
//	ArrayList<String> author, affiliation, country; 
//	
//	
//	
//	public static void main(String[] args) {
//		// TODO Auto-generated method stub
//		XDB xdb = new XDB();
//		xdb.getIJCAR("IJCAR2010");
//		//get the author info
//		DBoxGenerator gen = new DBoxGenerator();
//		gen.affiliation = xdb.affiliation;
//		gen.author = xdb.author;
//		gen.country = xdb.country;
//		gen.parsePubFile("pub_dblp.txt");
//	} 
//	
//	public void parsePubFile(String file){
//		try{
//			BufferedReader in = new BufferedReader(new FileReader(file));
//		    String strLine;
//		    FileWriter fstream = new FileWriter(file.substring(0, file.indexOf('.')) + ".dbox");
//	        BufferedWriter out = new BufferedWriter(fstream);
//	        HashSet<String> vs = new HashSet<String>();
//		    while ((strLine = in.readLine()) != null)   {
//		        // no empty lines as input
//		    	if (!strLine.trim().equals("")){
//		    		String[] fields = strLine.split("\t");
//		    		//title year venue authors
//		    		if(fields.length>=4){
//		    			out.write(setDBoxAsFile(fields));
//		    			vs.add(fields[2]);
//		    			out.newLine();
//		    			//break;
//		    		}else{
//		    			System.out.println("check the pub file: more fields required.");
//		    		}
//		    		//System.out.println(author.get(i)+":"+affiliation.get(i)+":"+country.get(i));
//		    	}
//
//		    }
//		    out.close();
//		    //give Jeff a list of venues
//		    FileWriter fstream2 = new FileWriter("listofvenues.txt");
//	        BufferedWriter venues = new BufferedWriter(fstream2);
//	        for(String s:vs){
//	        	venues.write(s);
//	        	venues.newLine();
//	        }
//	        venues.close();
//		}catch(IOException e){
//			e.printStackTrace();
//		}
//	}
//	
//	private String setDBoxAsFile(String[] fs){
//		//get title as a feature (= (role title) k)
//		//Note titles/names may have spaces: replaced by _
//		String dmtitle = "(= (role "+ft+") "+fs[0].replace(' ', '_')+")";
//		String dmyear = "(= (role "+fy+") "+fs[1]+")";
//		//a venue is a PConcept
//		String pcvenue = "("+fs[2].replace(' ', '_')+")";
//		//authors now
//		//there is a space ollowing the venue, not trimed by split(.), so start from index 4, not 3!
//		int i = 4;
//		String hasAuthors ="(and ";
//		while(i < fs.length){
//			boolean more = false;
//			//System.out.println("author: "+fs[i]);
//			String dmauthor = "", hasAuthor = "";
//			String dmname = "(= (role "+fn+") "+fs[i].replace(' ', '_')+")";
//			String dmaffiliation="", dmcountry="";
//			if(this.author.contains(fs[i])){
//				//this author is one of IJCAR2010 PC members!
//				more = true;
//				int k = this.author.indexOf(fs[i]);
//				dmaffiliation = "(= (role "+fa+") "+this.affiliation.get(k).replace(' ', '_')+")";
//				dmcountry = "(= (role "+fc+") "+this.country.get(k).replace(' ', '_')+")";
//			}
//			if(more){
//				//AndConcept
//				dmauthor = "(and "+dmname+" "+dmaffiliation+" "+dmcountry+")";
//			}else{
//				//one feature only
//				dmauthor = dmname;
//			}
//			hasAuthor = "(exists (role "+ rp +") "+dmauthor+") ";
//			hasAuthors += hasAuthor;
//			i++;
//		}
//		hasAuthors += ")";
//		String hasVenue = "(exists (role "+ ri +") "+pcvenue+")";
//		return "(and "+cp +" "+dmtitle+" "+dmyear+" "+hasAuthors+" "+hasVenue+" "+")";
//		
//	}
//	
//
//	
//
//}
